package pkg.entity;

import com.googlecode.objectify.Key;
import javax.persistence.Id;

public class User extends ObjectifyEntity {

    @Id
    Long id;
    String firstName;
    String lastName;
    String email;
    String password;
    String phoneNumber;
    String childName1;
    Key<Teacher> childTeacherKey1;
    String childName2;
    Key<Teacher> childTeacherKey2;
    String childName3;
    Key<Teacher> childTeacherKey3;
    String childName4;
    Key<Teacher> childTeacherKey4;
    Boolean admin;

    public String getChildName1() {
        return childName1;
    }

    public void setChildName1(String childName1) {
        this.childName1 = childName1;
    }

    public String getChildName2() {
        return childName2;
    }

    public void setChildName2(String childName2) {
        this.childName2 = childName2;
    }

    public String getChildName3() {
        return childName3;
    }

    public void setChildName3(String childName3) {
        this.childName3 = childName3;
    }

    public String getChildName4() {
        return childName4;
    }

    public void setChildName4(String childName4) {
        this.childName4 = childName4;
    }

    public Key<Teacher> getChildTeacherKey1() {
        return childTeacherKey1;
    }

    public void setChildTeacherKey1(Key<Teacher> childTeacherId1) {
        this.childTeacherKey1 = childTeacherId1;
    }

    public Long getChildTeacherId1() {
        return keyId(childTeacherKey1);
    }

    public void setChildTeacherId1(Long id) {
        if (id != null) {
            childTeacherKey1 = new Key<Teacher>(Teacher.class, id);
        } else {
            childTeacherKey1 = null;
        }
    }

    public Key<Teacher> getChildTeacherKey2() {
        return childTeacherKey2;
    }

    public void setChildTeacherKey2(Key<Teacher> childTeacherId2) {
        this.childTeacherKey2 = childTeacherId2;
    }

    public Long getChildTeacherId2() {
        return keyId(childTeacherKey2);
    }

    public void setChildTeacherId2(Long id) {
        if (id != null) {
            childTeacherKey2 = new Key<Teacher>(Teacher.class, id);
        } else {
            childTeacherKey2 = null;
        }
    }

    public Key<Teacher> getChildTeacherKey3() {
        return childTeacherKey3;
    }

    public void setChildTeacherKey3(Key<Teacher> childTeacherId3) {
        this.childTeacherKey3 = childTeacherId3;
    }

    public Long getChildTeacherId3() {
        return keyId(childTeacherKey3);
    }

    public void setChildTeacherId3(Long id) {
        if (id != null) {
            childTeacherKey3 = new Key<Teacher>(Teacher.class, id);
        } else {
            childTeacherKey3 = null;
        }
    }

    public Key<Teacher> getChildTeacherKey4() {
        return childTeacherKey4;
    }

    public void setChildTeacherKey4(Key<Teacher> childTeacherId4) {
        this.childTeacherKey4 = childTeacherId4;
    }

    public Long getChildTeacherId4() {
        return keyId(childTeacherKey4);
    }

    public void setChildTeacherId4(Long id) {
        if (id != null) {
            childTeacherKey4 = new Key<Teacher>(Teacher.class, id);
        } else {
            childTeacherKey4 = null;
        }
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getFullName() {
        return firstName + " " + lastName;
    }
    
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Boolean getAdmin() {
        if (admin == null) {
            admin = false;
        }
        return admin;
    }

    public void setAdmin(Boolean admin) {
        this.admin = admin;
    }

    public Key<User> getKey() {
        return new Key<User>(User.class, id);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 31 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public Key<ObjectifyEntity> getPrimaryKey() {
        return new Key(this.getClass(), id);
    }
}
